<?php 
/**
* 
*/
class RegController extends Controller
{
	public function index()
	{
		$name = "sdfsdf";
		$this->display();
	}

	public function checkdata()
	{
		// var_dump($_POST);

		echo json_encode(['error'=>0,'info'=>'可用']);
	}

	public function add()
	{
		$data = $_POST;

		$data['password'] = md5($data['password']);

		$data['ctime'] = time();

		unset($data['repassword']);

		$model = new Model('user');

		$res = $model->add($data);

		if($res){
			echo "注册成功";
		}
	}
}